﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StockOutNoteHeaderEditFromNeedMaterial.aspx.cs" Inherits="weba.Sales.StockOutNoteHeaderEditFromNeedMaterial" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.4, Version=4.0.20133.145, Culture=neutral, PublicKeyToken=9b75583953471eea" Namespace="C1.Web.Wijmo.Controls.C1Input" TagPrefix="wijmo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
         <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="30" background="../Images/tab_05.gif">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="12" height="30">
                                        <img src="../Images/tab_03.gif" width="12" height="30" />
                                    </td>
                                    <td>
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="46%" valign="middle">
                                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                        <tr>
                                                            <td>
                                                                <div align="center">
                                                                    <img src="../images/tb.gif" width="16" height="16" /></div>
                                                            </td>
                                                            <td width="95%">
                                                                <span class="titleBold12px">生成出库单</span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td width="54%" align="right">
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td width="16" height="30">
                                        <img src="../Images/tab_07.gif" width="16" height="30" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="8" background="../images/tab_12.gif">
                                        &nbsp;
                                    </td>
                                    <td>
                                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <asp:Panel runat="server" ID="pnlAdd" Width="100%" Visible="true">
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        材料类型：
                                                    </td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rbtnlMaterialCategoryID" runat="server" RepeatDirection="Horizontal">
                                                        </asp:RadioButtonList>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="rbtnlMaterialCategoryID"
                                                            Display="Dynamic" ErrorMessage="请选择材料类型" SetFocusOnError="True" ValidationGroup="val"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        名称/货号：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtName" runat="server" AutoPostBack="True" OnTextChanged="txtName_TextChanged"></asp:TextBox>
                                            
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="txtName"
                                                            Display="Dynamic" ErrorMessage="请输入材料名称" SetFocusOnError="True" ValidationGroup="val"></asp:RequiredFieldValidator>
                                                            <asp:CustomValidator ID="CustomValidator3" runat="server" ControlToValidate="txtName"
                                                            Display="Dynamic" ErrorMessage="不存在此材料，请重新输入" OnServerValidate="CustomValidator2_ServerValidate"
                                                            SetFocusOnError="True" ValidationGroup="val"></asp:CustomValidator>
                                                        <asp:Label ID="lblSalesOrderID" runat="server" Visible="False"></asp:Label>
                                                        <asp:Label ID="lblNeedMaterialID" runat="server" Visible="False"></asp:Label>
                                                        <asp:Label ID="lblStockOutNoteID" runat="server" Visible="False"></asp:Label>
                                                        <asp:Label ID="lblRootDepartmentID" runat="server" Visible="False"></asp:Label>
                                                    </td>
                                                </tr>
                                                
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        数量：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtQuantity" runat="server" ValidationGroup="val2" Width="50px"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtQuantity"
                                                            Display="Dynamic" ErrorMessage="请输入数量" SetFocusOnError="True" ValidationGroup="val"></asp:RequiredFieldValidator>
                                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ValidationGroup="val"
                                                            runat="server" ErrorMessage="只能输入整数或小数" ValidationExpression="^(\d)+(\.\d+)?$"
                                                            ControlToValidate="txtQuantity"></asp:RegularExpressionValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2" align="center">
                                                        <asp:Label ID="lblMsg2" runat="server" ForeColor="Red" Visible="False"></asp:Label>
                                                        <br />
                                                        <asp:Button ID="btnAddProduct" runat="server" Text="添加" OnClick="btnAddProduct_Click"
                                                            ValidationGroup="val" Font-Size="16px" Width="200px" Height="30px" />
                                                    </td>
                                                </tr>
                                            </asp:Panel>
                                            <tr>
                                                <td colspan="2" align="center">
                                                    <br />
                                                    <hr />
                                                    <asp:CustomValidator ID="CustomValidator1" runat="server" Display="Dynamic" ErrorMessage="请至少添加一项产品"
                                                        OnServerValidate="CustomValidator1_ServerValidate" ValidationGroup="ok"></asp:CustomValidator>
                                                    <br />
                                                    <asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="DetailID,MaterialID,ManufacturerID"
                                                        OnRowDeleting="myGridView_RowDeleting" Width="100%" OnRowDataBound="myGridView_RowDataBound"
                                                        OnRowCancelingEdit="myGridView_RowCancelingEdit" OnRowEditing="myGridView_RowEditing"
                                                        OnRowUpdating="myGridView_RowUpdating">
                                                        <Columns>
                                                            <asp:BoundField DataField="DetailID" HeaderText="ID" ReadOnly="True" />
                                                            <asp:BoundField DataField="Name" HeaderText="货号" ReadOnly="True" />
                                                            <asp:TemplateField HeaderText="数量">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblQuantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                                                                </ItemTemplate>
                                                                <EditItemTemplate>
                                                                    <asp:TextBox ID="txtQuantity" runat="server" Width="50px" Text='<%# Eval("Quantity") %>'></asp:TextBox>
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtQuantity"
                                                                        Display="Dynamic" ErrorMessage="请输入数量" SetFocusOnError="True" ValidationGroup="edit"
                                                                        ForeColor="White"></asp:RequiredFieldValidator>
                                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ValidationGroup="edit"
                                                                        runat="server" ErrorMessage="只能输入整数或小数" ValidationExpression="^(\d)+(\.\d+)?$"
                                                                        ControlToValidate="txtQuantity" Display="Dynamic" ForeColor="White"></asp:RegularExpressionValidator>
                                                                </EditItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="库存数量">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblMaterialInventory" runat="server"></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:CommandField HeaderText="修改" ShowEditButton="True" ValidationGroup="edit">
                                                                <ItemStyle Width="70px" />
                                                            </asp:CommandField>
                                                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="lbtnDel" runat="server" CausesValidation="False" CommandName="Delete"
                                                                        OnClientClick="return confirm(&quot;将删除此项目，且无法恢复，您确认删除此记录吗？&quot;)" Text="删除"></asp:LinkButton>
                                                                </ItemTemplate>
                                                                <ItemStyle Width="50px" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="30" align="right">
                                                    编号：
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtStockOutNoteNumber" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ControlToValidate="txtStockOutNoteNumber"
                                                        Display="Dynamic" ErrorMessage="请输入订货单编号" ValidationGroup="ok"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="30" align="right">
                                                    日期：
                                                </td>
                                                <td>
                                                    <%--<asp:TextBox ID="txtDateStockOut" runat="server"></asp:TextBox>
                                                    <AjaxControlToolkit:CalendarExtender ID="CalendarExtender1" runat="server" Format="yyyy-MM-dd"
                                                        TargetControlID="txtDateStockOut">
                                                    </AjaxControlToolkit:CalendarExtender>--%>
                                                    <wijmo:C1InputDate ID="txtDateStockOut" runat="server"></wijmo:C1InputDate>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="30" align="right">
                                                    经办人：
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblManagerTrueName" runat="server"></asp:Label>
                                                    <asp:Label ID="lblManagerUserName" runat="server" Visible="False"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" align="center">
                                                    <asp:Button ID="btnOK" runat="server" Text="保存修改" OnClick="btnOK_Click" Font-Size="16px"
                                                        Width="100px" Height="30px" ValidationGroup="ok" />
                                                    &nbsp;
                                                    <asp:Button ID="btnSubmit" runat="server" Font-Size="16px" Height="30px" OnClick="btnSubmit_Click"
                                                        Text="提交审核" ValidationGroup="ok" Width="100px" OnClientClick="return confirm(&quot;将提交出库单，且无法再修改，您确认提交此出库单吗？&quot;)" />
                                                    &nbsp;
                                                    <asp:Button ID="btnClose" runat="server" Font-Size="16px" Height="30px" Text="关闭"
                                                        Width="100px" OnClientClick="window.close();" />
                                                    <br />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td width="8" background="../images/tab_15.gif">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="35" background="../images/tab_19.gif">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="12" height="35">
                                        <img src="../images/tab_18.gif" width="12" height="35" />
                                    </td>
                                    <td align="center">
                                        &nbsp;
                                    </td>
                                    <td width="16">
                                        <img src="../images/tab_20.gif" width="16" height="35" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btnOK" />
                <asp:PostBackTrigger ControlID="btnSubmit" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
